<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'match-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
<!-- 
	<div class="row">
		<?php echo $form->labelEx($model,'_id'); ?>
		<?php echo $form->textField($model,'_id'); ?>
		<?php echo $form->error($model,'_id'); ?>
	</div>
 -->
 
 <div class="row">
		<?php echo $form->labelEx($model,'period'); ?>
		<?php echo $form->dropDownList($model,'period',Match::$PERIODS); ?>
		<?php echo $form->error($model,'period'); ?>
	</div>
 
	<?php echo CHtml::activeLabelEx($model,'datetime'); ?>
    <?php echo $form->textField($model,'datetime',array('id'=>'datetime', 'size'=>45,'maxlength'=>45)); ?>
    <?php $this->widget('application.extensions.calendar.SCalendar',
        array(
        'inputField'=>'datetime',
        'ifFormat'=>'%d/%m/%Y %H:%M',
        'showsTime'=>true
    ));
    ?>

	<div class="row">
		<?php echo $form->labelEx($model,'tournament'); ?>
		<?php echo $form->dropDownList($model,'tournament_id',Match::$TOURNAMENTS); ?>
		<?php echo $form->error($model,'tournament_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'hometeam'); ?>
		<?php echo $form->textField($model,'hometeam',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'hometeam'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'awayteam'); ?>
		<?php echo $form->textField($model,'awayteam',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'awayteam'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'homegoals'); ?>
		<?php echo $form->textField($model,'homegoals'); ?>
		<?php echo $form->error($model,'homegoals'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'awaygoals'); ?>
		<?php echo $form->textField($model,'awaygoals'); ?>
		<?php echo $form->error($model,'awaygoals'); ?>
	</div>
  <div class="row" id="togglePlayers">
 <?php echo CHtml::label('Αρχική ενδεκάδα:','playersArray'); ?>
 </div>
 <div class="row" id="playersArray">
 <?php echo $form->checkBoxList($model,'playersArray',Match::$PLAYERS[$model->period],
 array("style"=>"","separator"=>"", 
 "template"=>"<div style='float:left;width:150px'>{label}{input}</div>",
 "labelOptions"=>array("style"=>"font-weight:normal;float:left;width:100px")));?>
 </div>
	<div class="row" style="clear:left">
		<?php echo $form->labelEx($model,'stadium'); ?>
		<?php echo $form->textField($model,'stadium',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'stadium'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'channel'); ?>
		<?php echo $form->dropDownList($model,'channel_id',Match::$CHANNELS); ?>
		<?php echo $form->error($model,'channel_id'); ?>
	</div>
 
	<div class="row">
		<?php echo $form->labelEx($model,'deleted'); ?>
		<?php echo $form->checkbox($model,'deleted'); ?>
		<?php echo $form->error($model,'deleted'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->